/*
 * read_config.hpp
 *
 *  Created on: Mar 31, 2010
 *      Author: root
 */

#ifndef READ_CONFIG_HPP_
#define READ_CONFIG_HPP_
#include "msgouttocontrol.hpp"
#include "tinyxml.h"

class CConfig
{
	private:
	 TiXmlDocument mXmlConfigFile;
	 TiXmlElement* mRootElem;
    public:
	    CConfig(const char* xmlFileName);
	    const char* GetValue(const char* nodeName);
	    ~CConfig();
	    void getRootElem();
	    TiXmlElement* GetElemofromboot(const char* name);   //read from boot
	    TiXmlElement* GetElemofromElem(TiXmlElement* Elem,const char* name); //read from anther elem

	    u32 convtext_(TiXmlElement* SecendChild,const char* nodename);
	    const char* tconvtext_(TiXmlElement* SecendChild,const char* nodename);
	    void addcommport(TiXmlElement* SecendChild,const char* nodename);
};

#endif /* READ_CONFIG_HPP_ */
